﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ObjectCache
{
    public class BaseToken
    {
        private long mResetFilter;

        private static void CheckFilter(long resetFilter)
        {
            if (resetFilter == 0)
                throw new ArgumentException("0 is reserved by the filter");
        }

        public virtual bool IsCurrent
        {
            get { return true; }
        }

        public virtual void Renew()
        {
        }

        internal long ResetFilter
        {
            get { return mResetFilter; }
            set
            {
                CheckFilter(value);
                mResetFilter = value;
            }
        }
    }
}
